<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\Product;
use App\Models\ProductType;

class ArtController extends Controller
{
    public function index(Request $request,$id)
    {
    	$type_id = (int)$id;
    	$type = ProductType::find($type_id);
    	$list = Product::where(['type_id'=>$type_id])->paginate(10);
    	return view('painting.art-list',compact('list','type','type_id'));
    }

    public function show($id)
    {
    	$data = Product::find($id);
    	return view('painting.art-show',compact('data'));
    }
}
